﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="AwardEdit.aspx.cs" Inherits="ProjectSem40701.Admin.AwardEdit" ValidateRequest="false" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<%@ Register assembly="Telerik.Web.UI, Version=2009.1.311.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" namespace="Telerik.Web.UI" tagprefix="telerik" %>


<asp:Content ID="Content1" ContentPlaceHolderID="title" runat="server">
    <title>Cập nhật giải thưởng</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <!--
        set tab active here (BehaviorID="mdlPopup")
     -->
    <script type="text/javascript" language="javascript">
        setTab(document.getElementById("2"));
    </script>
    <!--
        end set tab active  BehaviorID="mdlPopup"
     -->
     <div id="box">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>      
        <h3>Cập nhật giải thưởng</h3>
        
        <fieldset class="fieldset">
            <legend>
                Thông tin giải thưởng
            </legend>    
            <p>
                <label>Kỳ thi:</label>
                <asp:DropDownList ID="cbbExam" runat="server" Width="158px" 
                    DataSourceID="ObjectDataSource1" DataTextField="ExamName" 
                    DataValueField="ExamID" ondatabound="cbbExam_DataBound">
                
                </asp:DropDownList>
                <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
                    OldValuesParameterFormatString="original_{0}" 
                    SelectMethod="Get_tbl_Exam_Select_All" 
                    TypeName="ProjectSem40701.Admin.AdminXSD.ExamTableAdapters.tbl_ExamTableAdapter">
                </asp:ObjectDataSource>
            </p>
            <p>
                <label>Nhà tài trợ:</label>
                <asp:DropDownList ID="cbbSponsor" runat="server" Width="158px" 
                    DataSourceID="ObjectDataSource4" DataTextField="SponsorName" 
                    DataValueField="SponsorID" ondatabound="cbbSponsor_DataBound">
                </asp:DropDownList>
                
                <asp:ObjectDataSource ID="ObjectDataSource4" runat="server" 
                    DataObjectTypeName="System.Guid" DeleteMethod="Delete" InsertMethod="Insert" 
                    OldValuesParameterFormatString="original_{0}" 
                    SelectMethod="Get_tbl_Sponsor_Select_All" 
                    TypeName="ProjectSem40701.Admin.AdminXSD.SponsorTableAdapters.tbl_SponsorTableAdapter" 
                    UpdateMethod="Update">
                    <UpdateParameters>
                        <asp:Parameter Name="SponsorName" Type="String" />
                        <asp:Parameter Name="SponsorAddress" Type="String" />
                        <asp:Parameter Name="SponsorPhone" Type="String" />
                        <asp:Parameter Name="SponsorEmail" Type="String" />
                        <asp:Parameter Name="SponsorDescription" Type="String" />
                        <asp:Parameter Name="SponsorStatus" Type="Int32" />
                        <asp:Parameter DbType="Guid" Name="Original_SponsorID" />
                    </UpdateParameters>
                    <InsertParameters>
                        <asp:Parameter DbType="Guid" Name="SponsorID" />
                        <asp:Parameter Name="SponsorName" Type="String" />
                        <asp:Parameter Name="SponsorAddress" Type="String" />
                        <asp:Parameter Name="SponsorPhone" Type="String" />
                        <asp:Parameter Name="SponsorEmail" Type="String" />
                        <asp:Parameter Name="SponsorDescription" Type="String" />
                        <asp:Parameter Name="SponsorStatus" Type="Int32" />
                    </InsertParameters>
                </asp:ObjectDataSource>
                               
            </p>   
            <p>
                <label>Tên giải thưởng:</label>
                <asp:TextBox ID="txtAwardName" runat="server" Width="150px"></asp:TextBox>
                <br />
            </p>     

                <label>Ảnh đại diện: </label>
               <asp:Image ID="imgAwardImage" runat="server" Width="100px" />
                <br />
                <label></label>
                 <asp:FileUpload ID="fileUpAwardImage" runat="server" />
                <br />
            
            <label>Mô tả:</label>
            <FCKeditorV2:FCKeditor ID="txtAwardDescription" runat="server" BasePath="../fck/" 
                Height="350px" Width="550px">
            </FCKeditorV2:FCKeditor> 
            
            <p>
                <label>Trạng thái:</label>
                <asp:DropDownList ID="cbbAwardStatus" runat="server" Width="158px">
                    <asp:ListItem Value="1">Hoạt động</asp:ListItem>
                    <asp:ListItem Value="0">Khóa</asp:ListItem>
                </asp:DropDownList>
            </p>
            
            <p>
                <asp:ObjectDataSource ID="ObjectDataSource3" runat="server" 
                    OldValuesParameterFormatString="original_{0}" 
                    SelectMethod="Get_tbl_Award_Select_All" 
                    TypeName="ProjectSem40701.Admin.AdminXSD.AwardTableAdapters.tbl_AwardTableAdapter">
                </asp:ObjectDataSource>
            </p> 
        </fieldset>
        
        <div align="center">
            <asp:Button ID="btnUpdate" runat="server" Text="Cập nhật" CssClass="button" 
                onclick="btnUpdate_Click" />
            <cc1:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" 
                ConfirmText="Bạn có thực sự muốn cập nhật giải thưởng này?" Enabled="True" TargetControlID="btnUpdate">
            </cc1:ConfirmButtonExtender>
            <asp:Button ID="btnDelete" runat="server" Text="Xóa giải thưởng" CssClass="button" 
                onclick="btnDelete_Click" />
            <cc1:ConfirmButtonExtender ID="btnDelete_ConfirmButtonExtender" runat="server" 
                ConfirmText="Bạn có thực sự muốn xóa giải thưởng này?" Enabled="True" TargetControlID="btnDelete">
            </cc1:ConfirmButtonExtender>
        </div>
        
     </div>
     
    <cc1:ModalPopupExtender ID="btnUpdate_ModalPopupExtender" runat="server" 
                    DynamicServicePath="" Enabled="False" TargetControlID="btnUpdate"
                    BackgroundCssClass="modalBackground"
                    PopupControlID="pnlPopup" >
    </cc1:ModalPopupExtender>
    <cc1:ModalPopupExtender ID="btnDelete_ModalPopupExtender" runat="server" 
                    DynamicServicePath="" Enabled="False" TargetControlID="btnDelete"
                    BackgroundCssClass="modalBackground"
                    PopupControlID="pnlPopup" >
    </cc1:ModalPopupExtender>

    <asp:Panel ID="pnlPopup" runat="server" CssClass="confirm-dialog" style="display:none;">
        <div class="inner">
            <h2>
                <asp:Literal ID="ltrMessage" runat="server"></asp:Literal>
            </h2>
            <div class="base">
                <asp:Label ID="lblSuccess" runat="server" Text="" Visible="false"></asp:Label>
                <asp:Button ID="btnYes" onclick="btnYes_Click" runat="server" Text="Yes" />                            
                <asp:LinkButton ID="LinkButton1" runat="server" CssClass="close" OnClick="btnClose_Click"
                    OnClientClick="$find('mdlPopup').hide(); return false;" />
            </div>
        </div>
    </asp:Panel>
     
</asp:Content>
